<template>
	<view>
		<u-navbar height="50" back-icon-color="#333" :title="title" title-color="#333" title-size="36">
		</u-navbar>
		<view class="">
			<u-parse :html="content"></u-parse>
		</view>
	</view>
</template>

<script>
	import {
		getprivacypolicy,
		getuseragreement,
		getshopintro,
		getaboutUrl
	} from '@/api/index.js'
	export default {
		data() {
			return {
				content: '',
				title: ''
			};
		},
		onLoad(options) {
			console.log(options);
			if (options.type == 1) {
				this.title = '用户协议'

			}
			if (options.type == 2) {
				this.title = '隐私政策'

			}
			if (options.type == 3) {
				this.title = '商家入驻协议'
			}
			if (options.type == 4) {
				this.title = '关于我们'
			}
			this.init(options.type);
		},
		methods: {
			init(str) {
				let that = this
				if (str == 1) {
					getuseragreement().then((res) => {
						console.log("用户协议", res);
						this.content = res
					})
				}
				if (str == 2) {
					getprivacypolicy().then((res) => {
						console.log("隐私政策", res);
						this.content = res
					})
				}
				if (str == 3) {
					getshopintro().then((res) => {
						console.log("数据", res);
						this.content = res.data
						// this.content = res.data.about
					})
				}
				if (str == 4) {
					getaboutUrl().then((res) => {
						console.log("数据", res);
						this.content = res.data.about
					})
				}
			}
		}
	}
</script>

<style lang="scss">

</style>